package com.tgy.thread;

/**
 * @Author: tgy
 * @Date: 12/1/20 5:25 PM
 */
public class Person {

    private volatile Person instance;

    private Person() {

    }

    public Person getInstance() {

        if (instance == null) {

            synchronized (Person.class) {

                if (instance == null) {
                    instance = new Person();
                }
            }
        }
        return instance;

    }
}
